/*
 * @Author: your name
 * @Date: 2021-12-22 18:45:13
 * @LastEditTime: 2021-12-22 18:49:40
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: /project_am/am-server/app/service/grade.js
 */

const { Service } = require('egg')
const BussinessError = require('../utils/BussinessError')

class GradeService extends Service {

//根据ID查询成绩
    async findGradeByID (id) {
        try {
        const { mysql } = this.app
        const grade = await mysql.select('school_grade', {
        where: { id }
        })
        return grade
        }catch(error){
        throw new BussinessError('查询失败')
        }
    }
}
module.exports = GradeService;